#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import set_can_baud_rate
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.set_can_baud_rate(id_num=data.id_num, baud_rate=data.baud_rate)
    rospy.loginfo("set_can_baud_rate_node")


def listener():
    rospy.init_node("set_can_baud_rate", anonymous=True)
    rospy.Subscriber("set_can_baud_rate", set_can_baud_rate, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

